<?php $this->headStyle()->captureStart() ?>
<?php $this->headStyle()->captureEnd() ?>

<?php $this->headScript()->captureStart() ?>
$(document).ready(function() {
    $(".delete").live('click',function(){ 
        var _currIndex = $(".delete").index($(this));
        var _currTr = $($('#dataTableB > tbody tr').get(_currIndex));
        var _roleId = $(this).attr("data-roleId"); 
        
        dialogConfirm($.languages.areYouSureToDelete, function(){
            $.ajax({ 
                type: "POST", 
                url: "<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'delete-role'),'default',true) ?>", 
                data: { roleId : _roleId},
                success:function(responseText, statusText){
                    var json = jQuery.parseJSON(responseText);
                    if(json.result != 1){ 
                        dialogMessage(json.messages);
                        return false;
                    }
                    
                    _currTr.remove();
                    return true;
                } 
            });
        });
        
    }); 
});
<?php $this->headScript()->captureEnd() ?>

<div class="clearfix append-top">
    <span class="column">
        <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-list', 'roleType'=>'guest'), "default", true); ?>"><?php echo $this->translate("Guest");?></a>
    </span>
    <span class="column">
        <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-list', 'roleType'=>'member'), "default", true); ?>"><?php echo $this->translate("Member");?></a>
    </span>
    <span class="column">
        <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-list', 'roleType'=>'admin'), "default", true); ?>"><?php echo $this->translate("Administrator");?></a>
    </span>
</div>

<div class="prepend-top append-top">
<table cellpadding="0" width="100%" cellspacing="0" border="1" class="" id="dataTableA">
<caption><em><?php echo $this->translate('System role');?></em></caption>
<thead> 
    <tr> 
        <th width="8%"><?php echo $this->translate('Role id');?></th> 
        <th width="18%"><?php echo $this->translate('Role name');?></th> 
        <th width="18%"><?php echo $this->translate('Parent role name');?></th> 
        <th><?php echo $this->translate('Description');?></th> 
        <th width="20%"></th> 
    </tr> 
</thead> 
<tbody> 
    <?php if(isset($this->roles['0']) && is_array($this->roles['0'])):?>
    <?php foreach ($this->roles['0'] as $key=>$roleRow):?>
    <tr class="role-base" id="<?php echo $roleRow['id'];?>"> 
        <td><?php echo $roleRow['id'];?></td> 
        <td><?php echo $roleRow['roleName'];?></td> 
        <td><?php echo $roleRow['parentRoleName'];?></td> 
        <td><?php echo $roleRow['description'];?></td>
        <td>
            <div class="clearfix">
                <span class="column">
                    <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-access-list', 'roleId'=>$roleRow['id']), "default", true); ?>"><?php echo $this->translate("Access setup");?></a>
                </span>
                <span class="column">
                    <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-form', 'roleId'=>$roleRow['id']), "default", true); ?>"><?php echo $this->translate("Edit");?></a>
                </span>
            </div>
        </td>
    </tr> 
    <?php endforeach;?>
    <?php endif;?>
</tbody>
<tfoot></tfoot>
</table> 
</div>

<div class="prepend-top append-top">
<table cellpadding="0" width="100%" cellspacing="0" border="1" class="" id="dataTableB"> 
<caption><em><?php echo $this->translate('Defined role');?></em></caption>
<thead> 
    <tr> 
        <th width="8%"><?php echo $this->translate('Role id');?></th> 
        <th width="18%"><?php echo $this->translate('Role name');?></th> 
        <th width="18%"><?php echo $this->translate('Parent role name');?></th> 
        <th><?php echo $this->translate('Description');?></th> 
        <th width="20%"></th> 
    </tr> 
</thead> 
<tbody> 
    <?php if(isset($this->roles['1']) && is_array($this->roles['1'])):?>
    <?php foreach ($this->roles['1'] as $key=>$roleRow):?>
    <tr class="role-base" id="<?php echo $roleRow['id'];?>"> 
        <td><?php echo $roleRow['id'];?></td> 
        <td><?php echo $roleRow['roleName'];?></td> 
        <td><?php echo $roleRow['parentRoleName'];?></td> 
        <td><?php echo $roleRow['description'];?></td>
        <td>
            <div class="clearfix">
                <span class="column">
                    <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-access-list', 'roleId'=>$roleRow['id']), "default", true); ?>"><?php echo $this->translate("Access setup");?></a>
                </span>
                <span class="column">
                    <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-form', 'roleId'=>$roleRow['id']), "default", true); ?>"><?php echo $this->translate("Edit");?></a>
                </span>
                <span class="column">
                    <div class="ui-icon-box"><span data-roleId="<?php echo $roleRow['id'];?>" class="delete ui-icon ui-icon-closethick" title="<?php echo $this->translate("Delete");?>"></span></div>
                </span>
            </div>
        </td>
    </tr> 
    <?php endforeach;?>
    <?php endif;?>
</tbody>
<tfoot></tfoot>
</table>
</div>

<hr>

<div class="prepend-top append-top">
    <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user-acl', 'action'=>'show-role-form', 'roleType'=>$this->roleType)); ?>"><?php echo $this->translate("Add new defined role");?></a>
</div>